package com.shunda.ysdgj.model.entity.goods;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.shunda.ysdgj.model.entity.base.BaseEntity;
import com.shunda.ysdgj.model.serializer.CustomDecimalSerializer;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.math.BigDecimal;
import java.util.List;

@Data
@TableName("ysdgj_goods_sku")
@Schema(description = "商品SKU")
public class GoodsSku extends BaseEntity {
    @Schema(description = "添加人ID")
    private Long sysUserId;

    @Schema(description = "店铺ID")
    private Long shopId;

    @Schema(description = "所属产品ID")
    private Long spuId;

    @Schema(description = "商品标题")
    private String skuTitle;

    @Schema(description = "商品展示图片Json字符串")
    private String skuImages;

    @Schema(description = "商品售价 用户实际购买的价格")
    @JsonSerialize(using = CustomDecimalSerializer.class)
    private BigDecimal skuPrice;

    @Schema(description = "商品市场价或原价")
    @JsonSerialize(using = CustomDecimalSerializer.class)
    private BigDecimal skuMarketPrice;

    @Schema(description = "商品规格Json字符串")
    private String skuSpec;

    @Schema(description = "商品上下架")
    private Integer skuSaleable;

    @Schema(description = "商品是否有效")
    private Integer skuValid;

    @Schema(description = "商品销量")
    private Long skuSaleNum;

    @Schema(description = "商品库存")
    private Long skuStockNum;

    @Schema(description = "商品可搜索规格")
    @TableField(exist = false)
    private List<GoodsSkuSpec> skuSpecList;
}
